home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / utility / pwg_key.zip / KRS100.ZIP / MAKEKEY.WCC < prev    next >
Text File  |  1995-05-18  |  3KB  |  91 lines

  1. '  MakeKey.wcc
  2. '  By Mark Schwandt & William Mantz
  3. '  Public Domain 1995.
  4. '  For use with the KRS Key Registration System by Mark Schwandt
  5. '  and William Mantz
  6. '
  7.  
  8. Dim CfgBBS as String*30
  9. Dim Expand as Integer
  10. Dim Totals as Long
  11. Dim Hack as String
  12. Dim ProgID as LONG
  13. Dim BBSRegNum as STRING*7
  14. Dim StrChkSum as Long
  15. Dim ProgChkSum AS LONG
  16. DIM BBSId as LONG
  17.  
  18. '  first, Get the BBS Name from MakeWild's Record information.
  19. '  Trim it and make it all UPPER CASE, then Get the CheckSum of it.
  20.  
  21. //********** Decoder **********
  22.  
  23. Start:
  24. CLS
  25. PRINT"@7F@┌@78@─────────────────────────────────────────────────────────────────────────────┐@7F@"
  26. PRINT"@7F@│                              MakeKey Ver 1.0                                @78@│@7F@"
  27. PRINT"@7F@│                                                                             @78@│@7F@"
  28. PRINT"@7F@│              @74@Enter WC! BBS Name @0E@[                             ]@7F@             @78@│@7F@"
  29. PRINT"@7F@│                                                                             @78@│@7F@"
  30. PRINT"@7F@│              @74@Enter the WC! Registration No.@0E@[       ]@7F@                        @78@│@7F@"
  31. PRINT"@7F@│                                                                             @78@│@7F@"
  32. PRINT"@7F@│              @74@Enter the Program ID Code (1-99999) @0E@[     ]@7F@                    @78@│@7F@"
  33. PRINT"@7F@│                                                                             @78@│@7F@"
  34. PRINT"@7F@│              @74@The Key for this Package is :@7F@                                  @78@│@7F@"
  35. PRINT"@7F@│                                                                             @78@│@7F@"
  36. PRINT"@7F@└─────────────────────────────────────────────────────────────────────────────@78@┘@09@"
  37. Locate 4,36:PRINT"@0A@";:CfgBBS = InputMask("","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
  38. Locate 6,47:PRINT"@0B@";:BBSregNum = InputMask("","99-9999")
  39. Locate 8,53:PRINT"@0D@";: ProgId = InputNumber("",1,99999)
  40.  
  41. StrChkSum = 0
  42. ProgChkSum = 0
  43. BBSRegNum = TRIM(BBSRegNum)
  44. BBSRegNum = UCASE(BBSRegNum)
  45. CfgBBS = TRIM(CfgBBS)
  46. CfgBBS = UCASE(CfgBBS)
  47.  
  48. For Expand = 1 to Len(cfgBBS)
  49.         StrChkSum = StrChkSum + Asc(Mid(cfgBBS,Expand,1))
  50. Next Expand
  51.  
  52. '  StrChkSum has the CheckSum of the BBS name.
  53.  
  54. '  Next, Get the BBS Reg Number from MakeWild's record Information.
  55. '  and Get the ChkSum of it.... ProgChkSum contains the iD.
  56.  
  57. ProgChkSum = 0
  58. For Expand = 1 to Len(BBSRegNum)
  59.         ProgChkSum = ProgChkSum + Asc(Mid(BBSRegNum,Expand,1))
  60. Next Expand
  61.  
  62. '  Add the cfgBBS CheckSum and the BBS ID checkSum together.
  63.  
  64. ProgChkSum = ProgChkSum + StrChkSum
  65.  
  66. '  Multiply the CheckSum by the Prime Number 7
  67.  
  68. ProgChkSum = ProgChkSum * 7
  69.  
  70. ' Multiply the ProgChkSum  by the Program's custom ID number.
  71.  
  72. ProgChkSum = ProgChkSum * ProgId
  73.  
  74. ' Add the Calculated CheckSum by Program's Custom ID Number.
  75.  
  76. ProgChkSum = ProgChkSum + ProgId
  77.  
  78. ' -------------------------------------------------------------
  79.  
  80. Locate 10,45
  81. PRINT FormatNumber(ProgChkSum, "##########")
  82. Locate 13,1
  83. Print "@0F@"
  84. If InputYesNo("Do you want to generate another Key? <Y/N>",True) Then
  85.         GOTO Start
  86. END IF
  87. END
  88.  
  89.  
  90.  
  91.